07. constants.h

C02 L06 A01 Header Constants.H

#ifndef PATH_H
#define PATH_H

#include <string>
using std::string;

enum CPUStates {
    S_USER = 1,
    S_NICE,
    S_SYSTEM,
    S_IDLE,
    S_IOWAIT,
    S_IRQ,
    S_SOFTIRQ,
    S_STEAL,
    S_GUEST,
    S_GUEST_NICE
};

class Path {
    public:
        static string basePath() 
        {
            return "/proc/";
        }
        static string cmdPath()
        {
            return "/cmdline";
        }
        static string statusPath()
        {
            return "/status";
        }
        static string statPath()
        {
            return "stat";
        }
        static string upTimePath()
        {
            return "uptime";
        }
        static string memInfoPath()
        {
            return "meminfo";
        }
        static string versionPath()
        {
            return "version";
        }
};

#endif // PATH_H

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a